using System.Collections;
using UnityEngine;

public class Cutscene_SansBeforePapyrus : MonoBehaviour
{
	public Vector3[] SansWalkPositions;

	public float[] SansWalkspeeds;

	public Susie_Follower Susie;

	public NPC Sans;

	public INT_Chat[] ChatsToDisable;

	public INT_Chat SansCutsceneChat;

	private int cutsceneIndex;

	private int SansWalkIndex;

	[Space(5f)]
	public TRIG_LEVELTRANSITION PapyrusRoomLevelPosition;

	public bool ActivatePrunselVarient;

	[Header("Before Cutscene Stuff")]
	public bool InLivingRoomMode;

	public bool WalkToKitchen;

	private bool previousWTK;

	public Vector2 LivingRoomPosition;

	public Vector2 KitchenPosition;

	private int walkamount;

	[SerializeField]
	private INT_Chat sansFinishedChat;

	[Header("Cutscene Stuff")]
	public AudioSource SansCutsceneSource;

	public AudioClip[] SansCutsceneSounds;

	public AudioReverbFilter PlayerCameraReverb;

	[Space(5f)]
	public SpriteRenderer PapyrusDoor;

	public Sprite PapyrusDoor_Open;

	[Space(5f)]
	public CHATBOXTEXT Papyrus_BaitnSwitch;

	public CHATBOXTEXT Susie_ConfirmKnight;

	public CHATBOXTEXT Susie_CountDown3;

	public CHATBOXTEXT Susie_CountDown2;

	public CHATBOXTEXT Susie_CountDown1;

	public CHATBOXTEXT Susie_CountDownGO;

	public CHATBOXTEXT Susie_ReplyToSans;

	public Vector3[] KrisCutscenePositions;

	public Vector3[] SusieCutscenePositions;

	[Space(5f)]
	[SerializeField]
	private HypothesisGoal Goal_AmbushPapyrus;

	[SerializeField]
	private HypothesisGoal Goal_GreetPapyrus;

	[SerializeField]
	private HypothesisGoal Goal_SusieSnack;

	[SerializeField]
	private HypothesisGoal Goal_PrunselAnomalies;

	private void Start()
	{
		Susie = PartyMemberSystem.Instance.HasMemberInParty(PartyMemberSystem.Instance.Default_Susie).PartyMemberFollowSettings;
	}

	public void StartCutscene()
	{
		((MonoBehaviour)this).StartCoroutine(Cutscene());
		PlayerPrefs.SetInt("PapyrusMeet_AmbushCutscene", 0);
	}

	private void Update()
	{
		if (cutsceneIndex != 0)
		{
			CutsceneUpdate();
			PlayerManager.Instance._PlayerState = PlayerManager.PlayerState.Cutscene;
			LightworldMenu.Instance.CanOpenMenu = false;
		}
		else if (InLivingRoomMode)
		{
			LivingRoomModeUpdate();
		}
	}

	private void LivingRoomModeUpdate()
	{
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0188: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		if (previousWTK != WalkToKitchen)
		{
			previousWTK = WalkToKitchen;
			if (Sans.CurrentWalkRoutine != null)
			{
				((MonoBehaviour)Sans).StopCoroutine(Sans.CurrentWalkRoutine);
				Sans.CurrentWalkRoutine = null;
			}
			walkamount++;
			if (walkamount > 6)
			{
				sansFinishedChat.IndexToLoop = 1;
				sansFinishedChat.FirstTextPlayed = true;
				sansFinishedChat.CurrentIndex = 1;
			}
		}
		if (WalkToKitchen && Vector2.op_Implicit(((Component)Sans).transform.position) != KitchenPosition && Sans.CurrentWalkRoutine == null)
		{
			Sans.WalkToPosition(Vector2.op_Implicit(KitchenPosition), 9f);
		}
		if (!WalkToKitchen && Vector2.op_Implicit(((Component)Sans).transform.position) != LivingRoomPosition && Sans.CurrentWalkRoutine == null)
		{
			Sans.WalkToPosition(Vector2.op_Implicit(LivingRoomPosition), 9f);
		}
		if (Vector2.op_Implicit(((Component)Sans).transform.position) == KitchenPosition)
		{
			Sans.RotateNPC(Vector2.up);
			Collider2D[] collidersToDisableOnWalk = Sans.CollidersToDisableOnWalk;
			for (int i = 0; i < collidersToDisableOnWalk.Length; i++)
			{
				((Behaviour)collidersToDisableOnWalk[i]).enabled = false;
			}
		}
		if (Vector2.op_Implicit(((Component)Sans).transform.position) == LivingRoomPosition)
		{
			Sans.RotateNPC(Vector2.right);
			sansFinishedChat.CanUse = true;
		}
		else
		{
			sansFinishedChat.CanUse = false;
		}
	}

	private void CutsceneUpdate()
	{
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_065e: Unknown result type (might be due to invalid IL or missing references)
		//IL_066a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0851: Unknown result type (might be due to invalid IL or missing references)
		//IL_085d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b41: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b4d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e29: Unknown result type (might be due to invalid IL or missing references)
		//IL_10f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_1105: Unknown result type (might be due to invalid IL or missing references)
		//IL_13d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_13e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02af: Unknown result type (might be due to invalid IL or missing references)
		//IL_0561: Unknown result type (might be due to invalid IL or missing references)
		//IL_056d: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0710: Unknown result type (might be due to invalid IL or missing references)
		//IL_071c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0697: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0903: Unknown result type (might be due to invalid IL or missing references)
		//IL_090f: Unknown result type (might be due to invalid IL or missing references)
		//IL_088a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0896: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bf3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b7a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b86: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b96: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ecf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0edb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e56: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e62: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e72: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ea0: Unknown result type (might be due to invalid IL or missing references)
		//IL_11ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_11b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_1132: Unknown result type (might be due to invalid IL or missing references)
		//IL_113e: Unknown result type (might be due to invalid IL or missing references)
		//IL_114e: Unknown result type (might be due to invalid IL or missing references)
		//IL_117c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1465: Unknown result type (might be due to invalid IL or missing references)
		//IL_1471: Unknown result type (might be due to invalid IL or missing references)
		//IL_140b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1417: Unknown result type (might be due to invalid IL or missing references)
		//IL_1427: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_031f: Unknown result type (might be due to invalid IL or missing references)
		//IL_032b: Unknown result type (might be due to invalid IL or missing references)
		//IL_033b: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_063c: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0741: Unknown result type (might be due to invalid IL or missing references)
		//IL_074d: Unknown result type (might be due to invalid IL or missing references)
		//IL_075d: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0934: Unknown result type (might be due to invalid IL or missing references)
		//IL_0940: Unknown result type (might be due to invalid IL or missing references)
		//IL_0950: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cc4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cc9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cd5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cda: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c24: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c30: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c40: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fa0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fa5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f00: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f0c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1c: Unknown result type (might be due to invalid IL or missing references)
		//IL_127c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1281: Unknown result type (might be due to invalid IL or missing references)
		//IL_128d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1292: Unknown result type (might be due to invalid IL or missing references)
		//IL_11dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_11e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_11f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_14e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_14ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_14f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_14fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_1493: Unknown result type (might be due to invalid IL or missing references)
		//IL_149f: Unknown result type (might be due to invalid IL or missing references)
		//IL_14af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03db: Unknown result type (might be due to invalid IL or missing references)
		//IL_081a: Unknown result type (might be due to invalid IL or missing references)
		//IL_081f: Unknown result type (might be due to invalid IL or missing references)
		//IL_082b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0830: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a12: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a23: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cfd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d02: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d0e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d13: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fd9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fde: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fef: Unknown result type (might be due to invalid IL or missing references)
		//IL_12b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_12ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_12c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_12cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_151b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1520: Unknown result type (might be due to invalid IL or missing references)
		//IL_152c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1531: Unknown result type (might be due to invalid IL or missing references)
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_0454: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d99: Unknown result type (might be due to invalid IL or missing references)
		//IL_1075: Unknown result type (might be due to invalid IL or missing references)
		//IL_1351: Unknown result type (might be due to invalid IL or missing references)
		switch (cutsceneIndex)
		{
		case 1:
			PlayerManager.Instance._PlayerState = PlayerManager.PlayerState.Cutscene;
			PlayerManager.Instance._PMove._rb.simulated = false;
			Susie.FollowingEnabled = false;
			if (SansWalkIndex < SansWalkPositions.Length && !Sans.ismoving)
			{
				Sans.WalkToPosition(SansWalkPositions[SansWalkIndex], SansWalkspeeds[SansWalkIndex]);
				Sans.ismoving = true;
			}
			if (Sans.FinishedMoveTo && SansWalkIndex < SansWalkPositions.Length)
			{
				SansWalkIndex++;
				Sans.FinishedMoveTo = false;
				Sans.ismoving = false;
			}
			PlayerManager.Instance._PMove.RotatePlayerAnim(new Vector2(0f, 1f));
			Susie.RotateSusieToDirection(new Vector2(0f, 1f));
			if (((Component)PlayerManager.Instance).transform.position != KrisCutscenePositions[0])
			{
				((Component)PlayerManager.Instance).transform.position = Vector3.MoveTowards(((Component)PlayerManager.Instance).transform.position, KrisCutscenePositions[0], 5f * Time.deltaTime);
			}
			if (((Component)Susie).transform.position != SusieCutscenePositions[0])
			{
				((Component)Susie).transform.position = Vector3.MoveTowards(((Component)Susie).transform.position, SusieCutscenePositions[0], 5f * Time.deltaTime);
			}
			if (((Component)Sans).transform.position == SansWalkPositions[SansWalkPositions.Length - 1])
			{
				cutsceneIndex = 26;
				((MonoBehaviour)this).StartCoroutine(SansKnockScene());
			}
			break;
		case 2:
			cutsceneIndex = 3;
			break;
		case 4:
			if (((Component)PlayerManager.Instance).transform.position != KrisCutscenePositions[1])
			{
				((Component)PlayerManager.Instance).transform.position = Vector3.MoveTowards(((Component)PlayerManager.Instance).transform.position, KrisCutscenePositions[1], 2f * Time.deltaTime);
				PlayerManager.Instance._PMove.AnimationOverriden = true;
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", true);
			}
			if (((Component)Susie).transform.position != SusieCutscenePositions[1])
			{
				((Component)Susie).transform.position = Vector3.MoveTowards(((Component)Susie).transform.position, SusieCutscenePositions[1], 2f * Time.deltaTime);
				Susie.AnimationOverriden = true;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 1f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 100f);
			}
			if (((Component)Susie).transform.position == SusieCutscenePositions[1] && ((Component)PlayerManager.Instance).transform.position == KrisCutscenePositions[1])
			{
				Susie.AnimationOverriden = false;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 0f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 0f);
				Susie.RotateSusieToDirection(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove.AnimationOverriden = false;
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", false);
				SetupCutscene4();
			}
			break;
		case 7:
			PlayerManager.Instance._PlayerState = PlayerManager.PlayerState.Cutscene;
			if (((Component)Susie).transform.position != SusieCutscenePositions[2])
			{
				((Component)Susie).transform.position = Vector3.MoveTowards(((Component)Susie).transform.position, SusieCutscenePositions[2], 6f * Time.deltaTime);
				Susie.AnimationOverriden = true;
				Susie.SusieAnimator.SetFloat("VelocityX", -1f);
				Susie.SusieAnimator.SetFloat("VelocityY", 0f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 100f);
			}
			if (((Component)Susie).transform.position == SusieCutscenePositions[2])
			{
				Susie.AnimationOverriden = false;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 0f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 0f);
				Susie.RotateSusieToDirection(new Vector2(-1f, 0f));
				SansCutsceneSource.PlayOneShot(SansCutsceneSounds[1]);
				Susie.SusieAnimator.Play("Susie_TalkKris");
				PlayerManager.Instance._PMove.AnimationOverriden = true;
				PlayerManager.Instance._PMove.RotatePlayerAnim(new Vector2(1f, 0f));
				((MonoBehaviour)this).StartCoroutine(Cutscene8());
			}
			break;
		case 9:
			if (((Component)PlayerManager.Instance).transform.position != KrisCutscenePositions[2])
			{
				((Component)PlayerManager.Instance._PMove).transform.position = Vector3.MoveTowards(((Component)PlayerManager.Instance._PMove).transform.position, KrisCutscenePositions[2], 5f * Time.deltaTime);
				PlayerManager.Instance._PMove.AnimationOverriden = true;
				PlayerManager.Instance._PMove.RotatePlayerAnim(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", true);
			}
			if (((Component)Susie).transform.position != SusieCutscenePositions[3])
			{
				((Component)Susie).transform.position = Vector3.MoveTowards(((Component)Susie).transform.position, SusieCutscenePositions[3], 4f * Time.deltaTime);
				Susie.AnimationOverriden = true;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 1f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 100f);
				Susie.SusieAnimator.Play("Walk");
			}
			if (Vector2.Distance(Vector2.op_Implicit(((Component)Susie).transform.position), Vector2.op_Implicit(SusieCutscenePositions[3])) < 0.5f)
			{
				Vector2.Distance(Vector2.op_Implicit(((Component)PlayerManager.Instance._PMove).transform.position), Vector2.op_Implicit(KrisCutscenePositions[2]));
				_ = 0.5f;
			}
			break;
		case 10:
			if (((Component)PlayerManager.Instance._PMove).transform.position != KrisCutscenePositions[3])
			{
				((Component)PlayerManager.Instance._PMove).transform.position = Vector3.MoveTowards(((Component)PlayerManager.Instance._PMove).transform.position, KrisCutscenePositions[3], 2f * Time.deltaTime);
				PlayerManager.Instance._PMove.AnimationOverriden = true;
				PlayerManager.Instance._PMove.RotatePlayerAnim(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", true);
			}
			if (((Component)Susie).transform.position != SusieCutscenePositions[4])
			{
				((Component)Susie).transform.position = Vector3.MoveTowards(((Component)Susie).transform.position, SusieCutscenePositions[4], 2f * Time.deltaTime);
				Susie.AnimationOverriden = true;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 1f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 100f);
				Susie.SusieAnimator.Play("Walk");
			}
			if (Vector2.Distance(Vector2.op_Implicit(((Component)Susie).transform.position), Vector2.op_Implicit(SusieCutscenePositions[4])) < 0.5f && Vector2.Distance(Vector2.op_Implicit(((Component)PlayerManager.Instance._PMove).transform.position), Vector2.op_Implicit(KrisCutscenePositions[3])) < 0.5f)
			{
				cutsceneIndex = 11;
				Susie.AnimationOverriden = false;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 0f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 0f);
				Susie.RotateSusieToDirection(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove.AnimationOverriden = false;
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", false);
			}
			break;
		case 11:
			cutsceneIndex = 12;
			ChatboxManager.Instance.CurrentTextIndex = 0;
			SansCutsceneChat.Text = Susie_CountDown3;
			SansCutsceneChat.OnBottom = false;
			SansCutsceneChat.CurrentIndex = 0;
			SansCutsceneChat.FirstTextPlayed = false;
			SansCutsceneChat.RUN();
			break;
		case 13:
			if (((Component)PlayerManager.Instance._PMove).transform.position != KrisCutscenePositions[4])
			{
				((Component)PlayerManager.Instance._PMove).transform.position = Vector3.MoveTowards(((Component)PlayerManager.Instance._PMove).transform.position, KrisCutscenePositions[4], 2f * Time.deltaTime);
				PlayerManager.Instance._PMove.AnimationOverriden = true;
				PlayerManager.Instance._PMove.RotatePlayerAnim(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", true);
			}
			if (((Component)Susie).transform.position != SusieCutscenePositions[5])
			{
				((Component)Susie).transform.position = Vector3.MoveTowards(((Component)Susie).transform.position, SusieCutscenePositions[5], 2f * Time.deltaTime);
				Susie.AnimationOverriden = true;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 1f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 100f);
				Susie.SusieAnimator.Play("Walk");
			}
			if (Vector2.Distance(Vector2.op_Implicit(((Component)Susie).transform.position), Vector2.op_Implicit(SusieCutscenePositions[5])) < 0.5f && Vector2.Distance(Vector2.op_Implicit(((Component)PlayerManager.Instance._PMove).transform.position), Vector2.op_Implicit(KrisCutscenePositions[4])) < 0.5f)
			{
				cutsceneIndex = 14;
				Susie.AnimationOverriden = false;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 0f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 0f);
				Susie.RotateSusieToDirection(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove.AnimationOverriden = false;
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", false);
			}
			ChatboxManager.Instance.CurrentTextIndex = 0;
			SansCutsceneChat.Text = Susie_CountDown2;
			SansCutsceneChat.OnBottom = false;
			SansCutsceneChat.CurrentIndex = 0;
			SansCutsceneChat.FirstTextPlayed = false;
			break;
		case 15:
			if (((Component)PlayerManager.Instance._PMove).transform.position != KrisCutscenePositions[5])
			{
				((Component)PlayerManager.Instance._PMove).transform.position = Vector3.MoveTowards(((Component)PlayerManager.Instance._PMove).transform.position, KrisCutscenePositions[5], 2f * Time.deltaTime);
				PlayerManager.Instance._PMove.AnimationOverriden = true;
				PlayerManager.Instance._PMove.RotatePlayerAnim(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", true);
			}
			if (((Component)Susie).transform.position != SusieCutscenePositions[6])
			{
				((Component)Susie).transform.position = Vector3.MoveTowards(((Component)Susie).transform.position, SusieCutscenePositions[6], 2f * Time.deltaTime);
				Susie.AnimationOverriden = true;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 1f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 100f);
				Susie.SusieAnimator.Play("Walk");
			}
			if (Vector2.Distance(Vector2.op_Implicit(((Component)Susie).transform.position), Vector2.op_Implicit(SusieCutscenePositions[6])) < 0.5f && Vector2.Distance(Vector2.op_Implicit(((Component)PlayerManager.Instance._PMove).transform.position), Vector2.op_Implicit(KrisCutscenePositions[5])) < 0.5f)
			{
				cutsceneIndex = 16;
				Susie.AnimationOverriden = false;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 0f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 0f);
				Susie.RotateSusieToDirection(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove.AnimationOverriden = false;
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", false);
			}
			ChatboxManager.Instance.CurrentTextIndex = 0;
			SansCutsceneChat.Text = Susie_CountDown1;
			SansCutsceneChat.OnBottom = false;
			SansCutsceneChat.CurrentIndex = 0;
			SansCutsceneChat.FirstTextPlayed = false;
			break;
		case 17:
			if (((Component)PlayerManager.Instance._PMove).transform.position != KrisCutscenePositions[6])
			{
				((Component)PlayerManager.Instance._PMove).transform.position = Vector3.MoveTowards(((Component)PlayerManager.Instance._PMove).transform.position, KrisCutscenePositions[6], 2f * Time.deltaTime);
				PlayerManager.Instance._PMove.AnimationOverriden = true;
				PlayerManager.Instance._PMove.RotatePlayerAnim(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", true);
			}
			if (((Component)Susie).transform.position != SusieCutscenePositions[7])
			{
				((Component)Susie).transform.position = Vector3.MoveTowards(((Component)Susie).transform.position, SusieCutscenePositions[7], 2f * Time.deltaTime);
				Susie.AnimationOverriden = true;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 1f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 100f);
				Susie.SusieAnimator.Play("Walk");
			}
			if (Vector2.Distance(Vector2.op_Implicit(((Component)Susie).transform.position), Vector2.op_Implicit(SusieCutscenePositions[7])) < 0.5f && Vector2.Distance(Vector2.op_Implicit(((Component)PlayerManager.Instance._PMove).transform.position), Vector2.op_Implicit(KrisCutscenePositions[6])) < 0.5f)
			{
				cutsceneIndex = 18;
				Susie.AnimationOverriden = false;
				Susie.SusieAnimator.SetFloat("VelocityX", 0f);
				Susie.SusieAnimator.SetFloat("VelocityY", 0f);
				Susie.SusieAnimator.SetFloat("VelocityMagnitude", 0f);
				Susie.RotateSusieToDirection(new Vector2(0f, 1f));
				PlayerManager.Instance._PMove.AnimationOverriden = false;
				PlayerManager.Instance._PMove._anim.SetBool("MOVING", false);
			}
			ChatboxManager.Instance.CurrentTextIndex = 0;
			SansCutsceneChat.Text = Susie_CountDownGO;
			SansCutsceneChat.OnBottom = false;
			SansCutsceneChat.CurrentIndex = 0;
			SansCutsceneChat.FirstTextPlayed = false;
			break;
		case 19:
			if (((Component)PlayerManager.Instance._PMove).transform.position != KrisCutscenePositions[2])
			{
				((Component)PlayerManager.Instance._PMove).transform.position = Vector3.MoveTowards(((Component)PlayerManager.Instance._PMove).transform.position, KrisCutscenePositions[2], 8f * Time.deltaTime);
				PlayerManager.Instance._PMove.AnimationOverriden = true;
				PlayerManager.Instance._PMove._anim.Play("Kris_SprintUp");
			}
			if (((Component)Susie).transform.position != SusieCutscenePositions[3])
			{
				((Component)Susie).transform.position = Vector3.MoveTowards(((Component)Susie).transform.position, SusieCutscenePositions[3], 7f * Time.deltaTime);
				Susie.AnimationOverriden = true;
				Susie.SusieAnimator.Play("Susie_SprintUp");
			}
			if (Vector2.Distance(Vector2.op_Implicit(((Component)Susie).transform.position), Vector2.op_Implicit(SusieCutscenePositions[3])) < 0.5f && Vector2.Distance(Vector2.op_Implicit(((Component)PlayerManager.Instance._PMove).transform.position), Vector2.op_Implicit(KrisCutscenePositions[2])) < 0.5f)
			{
				cutsceneIndex = 420;
			}
			break;
		case 3:
		case 5:
		case 6:
		case 8:
		case 12:
		case 14:
		case 16:
		case 18:
			break;
		}
	}

	private IEnumerator Cutscene()
	{
		cutsceneIndex = 1;
		yield return (object)new WaitForSeconds(1f);
	}

	public void SetupCutscene2()
	{
		PlayerManager.Instance._PMove.Manager._PlayerState = PlayerManager.PlayerState.Cutscene;
		cutsceneIndex = 4;
	}

	private IEnumerator Cutscene4()
	{
		MusicManager.StopSong(Fade: true, 0.5f);
		PlayerCameraReverb.reverbPreset = (AudioReverbPreset)10;
		PapyrusDoor.sprite = PapyrusDoor_Open;
		SansCutsceneSource.PlayOneShot(SansCutsceneSounds[0]);
		yield return (object)new WaitForSeconds(2f);
		SansCutsceneChat.Text = Papyrus_BaitnSwitch;
		SansCutsceneChat.CurrentIndex = 0;
		SansCutsceneChat.FirstTextPlayed = false;
		SansCutsceneChat.RUN();
	}

	public void SetupCutscene4()
	{
		PlayerManager.Instance._PMove.Manager._PlayerState = PlayerManager.PlayerState.Cutscene;
		cutsceneIndex = 5;
		((MonoBehaviour)this).StartCoroutine(Cutscene4());
	}

	public void SetupCutscene6()
	{
		PlayerCameraReverb.reverbPreset = (AudioReverbPreset)0;
		PlayerManager.Instance._PMove.Manager._PlayerState = PlayerManager.PlayerState.Cutscene;
		cutsceneIndex = 6;
		((MonoBehaviour)this).StartCoroutine(Cutscene6());
	}

	public void Susie_Countdown()
	{
		cutsceneIndex++;
		((MonoBehaviour)this).StartCoroutine(CounterDelay());
		PlayerManager.Instance._PMove.Manager._PlayerState = PlayerManager.PlayerState.Cutscene;
	}

	public void Susie_CountdownFinale()
	{
		SansCutsceneSource.PlayOneShot(SansCutsceneSounds[2]);
		cutsceneIndex++;
		PlayerManager.Instance._PMove.Manager._PlayerState = PlayerManager.PlayerState.Cutscene;
		PapyrusRoomLevelPosition.BeginTransition(2.45f);
	}

	private IEnumerator Cutscene6()
	{
		PlayerManager.Instance._PMove.Manager._PlayerState = PlayerManager.PlayerState.Cutscene;
		yield return (object)new WaitForSeconds(1f);
		Sans.AnimateAutomatically = false;
		PlayerCameraReverb.reverbPreset = (AudioReverbPreset)0;
		Sans.PlayAnimation("Idle");
		Sans.RotateNPC(Vector2.right);
		yield return (object)new WaitForSeconds(0.5f);
		Sans.PlayAnimation("Idle");
		Sans.RotateNPC(Vector2.down);
		yield return (object)new WaitForSeconds(1.2f);
		SansCutsceneChat.Text = Susie_ConfirmKnight;
		SansCutsceneChat.CurrentIndex = 0;
		SansCutsceneChat.FirstTextPlayed = false;
		SansCutsceneChat.ManualTextboxPosition = true;
		SansCutsceneChat.OnBottom = true;
		SansCutsceneChat.RUN();
		cutsceneIndex = 999;
	}

	public void StartChat_SusieReplyToSans()
	{
		((MonoBehaviour)this).StartCoroutine(DelayForSusieReply());
	}

	private IEnumerator DelayForSusieReply()
	{
		yield return (object)new WaitForSeconds(0.5f);
		SansCutsceneChat.Text = Susie_ReplyToSans;
		SansCutsceneChat.CurrentIndex = 0;
		SansCutsceneChat.FirstTextPlayed = false;
		SansCutsceneChat.ManualTextboxPosition = true;
		SansCutsceneChat.OnBottom = false;
		SansCutsceneChat.RUN();
	}

	public void EndCutscene()
	{
		PlayerManager.Instance._PMove.Manager._PlayerState = PlayerManager.PlayerState.Cutscene;
		PapyrusRoomLevelPosition.BeginTransition();
	}

	private IEnumerator Cutscene8()
	{
		if (!ActivatePrunselVarient)
		{
			cutsceneIndex = 8;
			yield return (object)new WaitForSeconds(0.45f);
			ChatboxManager.Instance.CurrentTextIndex = 0;
			SansCutsceneChat.Text = Susie_ConfirmKnight;
			SansCutsceneChat.OnBottom = false;
			SansCutsceneChat.CurrentIndex = 0;
			SansCutsceneChat.FirstTextPlayed = false;
			SansCutsceneChat.RUN();
		}
		else
		{
			cutsceneIndex = 19;
			PapyrusRoomLevelPosition.BeginTransition();
			yield return (object)new WaitForSeconds(0.25f);
		}
	}

	public void BeginWalkToDoor()
	{
		((MonoBehaviour)this).StartCoroutine(WalkToDoorTimed());
		HypotheticalGoalManager.Instance.CompleteGoal(Goal_GreetPapyrus);
	}

	public void SprintToDoor()
	{
		cutsceneIndex = 10;
		((MonoBehaviour)this).StartCoroutine(SprintToDoorTimed());
		PlayerPrefs.SetInt("PapyrusMeet_AmbushCutscene", 1);
		HypotheticalGoalManager.Instance.CompleteGoal(Goal_AmbushPapyrus);
	}

	public void FaceSusieToSans()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		Susie.RotateSusieTowardsPosition(Vector2.op_Implicit(((Component)this).transform.position));
	}

	private IEnumerator WalkToDoorTimed()
	{
		PapyrusRoomLevelPosition.BeginTransition();
		yield return (object)new WaitForSeconds(0.25f);
		cutsceneIndex = 9;
	}

	private IEnumerator SprintToDoorTimed()
	{
		yield return (object)new WaitForSeconds(0.5f);
		SansCutsceneChat.RUN();
	}

	private IEnumerator CounterDelay()
	{
		yield return (object)new WaitForSeconds(1f);
		SansCutsceneChat.RUN();
	}

	private IEnumerator SansKnockScene()
	{
		yield return (object)new WaitForSeconds(0.5f);
		PapyrusDoor.sprite = PapyrusDoor_Open;
		SansCutsceneSource.PlayOneShot(SansCutsceneSounds[0]);
		MusicManager.StopSong(Fade: true, 0.5f);
		PlayerCameraReverb.reverbPreset = (AudioReverbPreset)10;
		yield return (object)new WaitForSeconds(1.2f);
		SansCutsceneChat.Text = Papyrus_BaitnSwitch;
		SansCutsceneChat.CurrentIndex = 0;
		SansCutsceneChat.FirstTextPlayed = false;
		SansCutsceneChat.ManualTextboxPosition = true;
		SansCutsceneChat.OnBottom = true;
		SansCutsceneChat.RUN();
		yield return (object)new WaitForSeconds(0.3f);
		cutsceneIndex = 2;
	}

	public void CompleteSusieSnack()
	{
		HypotheticalGoalManager.Instance.CompleteGoal(Goal_SusieSnack);
	}

	public void IncrementPrunselAnomaly()
	{
		HypotheticalGoalManager.Instance.IncrementGoal(Goal_PrunselAnomalies, 1);
	}

	public void EnableSansLivingRoomMode()
	{
		InLivingRoomMode = true;
	}
}
